<?php

$filename = $_GET['appid'];

if(!file_exists($filename)) {
    die("该文件不存在");
}

$fileinfo = pathinfo($filename);

$size = filesize($filename);
$size2 = $size-1;

header('Content-Range:bytes 0-'.$size2.'/'.$size);
header('Content-Type:application/octet-stream');
header('Content-Type: multipart/byteranges');
header('Content-Length:'.$size);
header('Content-Disposition:attachment;filename='.$fileinfo['basename']);

flush();
readfile($filename);
exit(0);
